<?php
namespace Lisheng\HiAdmin\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
// use Lisheng\HiAdmin\Models\Role;
class RoleController{

	public function index(){

		return view('admin.role');
	}

	public function postRole(Request $request){

		$roleInfo = $request->only(['name','display_name','description']);

		// $validator = Validator::make($roleInfo,[
		// 		'name'=>'required',	
		// 		'display_name'=>'required',
		// 		'description'=>'required',
		// 	]);

		// if($validator->fails())
		// {
		// 	return redirect()->back();
		// }

		// $owner = new Role();
		// $owner->name         = $roleInfo['name'];
		// $owner->display_name = $roleInfo['display_name'];
		// $owner->description  = $roleInfo['description']; // optional
		
		// if($owner->save())
		// {
		// 	 return redirect(admin_base_path('roles'))->with('status', '添加角色信息成功');
		// }
	}

	public function getRoleList()
	{
		// $rolelist = Role::get()->toArray();

		return view('admin.roles');
	}
}